//num每一个位数相加

#include <stdio.h>
int main(){
	int num = 0;
	int sum = 0;
	printf("输入一个数字：");
	scanf("%d",&num);
	
	for(int i = 0 ; num > 0 ;i++){	
		sum = sum + num % 10;
		num = num / 10;
	}

	printf("%d\n",sum);

	return 0;
}
